(function(e) {
    e && e.__esModule;
})(require("../../utils/config.js")), require("../../utils/api.js");

var e = require("../../utils/util.js"), t = (require("../../wxParse/wxParse.js"), 
require("../../utils/wxApi.js"), require("../../utils/wxRequest.js"), require("../../utils/auth.js"));

getApp();

Page({
    data: {
        posterImageUrl: "",
        dialog: {
            title: "",
            content: "",
            hidden: !0
        }
    },
    onLoad: function(e) {
        var t = this;
        wx.setNavigationBarTitle({
            title: "海报",
            success: function(e) {}
        }), t.setData({
            posterImageUrl: e.posterImageUrl
        });
    },
    onShow: function(e) {},
    savePosterImage: function() {
        var e = this;
        wx.downloadFile({
            url: e.data.posterImageUrl,
            success: function(e) {
                wx.saveImageToPhotosAlbum({
                    filePath: e.tempFilePath,
                    success: function(e) {
                        console.log(e), wx.showModal({
                            title: "提示",
                            content: "二维码海报已存入手机相册，赶快分享到朋友圈吧",
                            showCancel: !1,
                            success: function(e) {
                                e.confirm && wx.navigateBack({
                                    delta: 1
                                });
                            }
                        });
                    }
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    posterImageClick: function(e) {
        var t = e.currentTarget.dataset.src;
        wx.previewImage({
            urls: [ t ]
        });
    },
    userAuthorization: function() {
        wx.getSetting({
            success: function(o) {
                console.log(o.authSetting);
                var s = o.authSetting;
                e.isEmptyObject(s) ? console.log("第一次授权") : (console.log("不是第一次授权", s), !1 === s["scope.userInfo"] && wx.showModal({
                    title: "用户未授权",
                    content: "如需正常使用评论、点赞等功能需授权获取用户信息。是否在授权管理中选中“用户信息”?",
                    showCancel: !0,
                    cancelColor: "#296fd0",
                    confirmColor: "#296fd0",
                    confirmText: "设置权限",
                    success: function(e) {
                        e.confirm && (console.log("用户点击确定"), wx.openSetting({
                            success: function(e) {
                                console.log("打开设置", e.authSetting), e.authSetting["scope.userInfo"] && t.getUsreInfo();
                            }
                        }));
                    }
                }));
            }
        });
    }
});